package mr.ali.videoapp.portal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import mr.ali.videoapp.portal.model.CollectionUrl;
import mr.ali.videoapp.portal.mapper.CollectionUrlMapper;
import mr.ali.videoapp.portal.service.ICollectionUrlService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr-ali
 * @since 2025-06-01
 */
@Service
public class CollectionUrlServiceImpl extends ServiceImpl<CollectionUrlMapper, CollectionUrl> implements ICollectionUrlService {

    @Resource
    private CollectionUrlMapper collectionUrlMapper;

    @Override
    public List<CollectionUrl> getCollectionUrl(Integer videoId) {
        QueryWrapper<CollectionUrl> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("video_id", videoId);
        queryWrapper.orderByAsc("video_ji");
        return collectionUrlMapper.selectList(queryWrapper);
    }
}
